import { useContext } from "react"
import Editor from "./component/Editor"
import FileNameList from "./component/FileNameList"
import { PlaygroundContext } from "./PlaygroundContext"
export default function CodeEditor(){
    const {files,selectdFileName} = useContext(PlaygroundContext)
    const file = files[selectdFileName]
    const changeHandle = ()=>{
        console.log(...arguments)
    }
    return (
        <div style={{height:'100%'}}>
            <FileNameList></FileNameList>
            <Editor file={file} onchange={changeHandle}></Editor>
        </div>
    )
}